﻿using System.ServiceModel;
using Library.Models;

namespace Library.Wcf
{
    public class UserWcfClient : ClientBase<IUserWcfService>, IUserWcfService
    {
        public UserWcfClient(string address) : base(new BasicHttpBinding(), new EndpointAddress(address))
        {}


        public User ValidateUser(string login, string pass)
        {
            return Channel.ValidateUser(login, pass);
        }

        public User AddUser(string login, string pass, User newUser)
        {
            return Channel.AddUser(login, pass, newUser);
        }

        public void ChangePassword(string login, string pass, string newPass)
        {
            Channel.ChangePassword(login, pass, newPass);
        }

        public void ChangeRole(string user, string pass, string roleUser, UserRole role)
        {
            Channel.ChangeRole(user, pass, roleUser, role);
        }

        public void RemoveUser(string login, string pass, string userToRemove)
        {
            Channel.RemoveUser(login, pass, userToRemove);
        }
    }


}
